<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        
        // 3. 提取元素
        let url = "http://item.taobao.com/item.htm?a=1&b=2&c=&d=xxx&e";
        function getUrlParams(url) {
            let params = {};
            let parser = new URL(url);
            for (let [key, value] of parser.searchParams.entries()) {
                params[key] = value || undefined;
            }
            return params;
        }
        console.log( getUrlParams(url));

    </script>
</body>
</html>